Skip to content

Release v0.7.9 — aCCF validity mask, speed filtering & physics updates - #65

Merged
JarryGabriel merged 13 commits into
mainfrom
fix/accf-validity-mask-nan
Mar 25, 2026
Merged

Release v0.7.9 — aCCF validity mask, speed filtering & physics updates#65
JarryGabriel merged 13 commits into
mainfrom
fix/accf-validity-mask-nan

Conversation

@JarryGabriel

Copy link
Copy Markdown
Member

Summary

This PR bundles several improvements to the NEATS pipeline covering data quality, physical accuracy, and robustness of the performance model.

Changes

🐛 Bug Fixes

  • aCCF validity mask — Waypoints outside the aCCF validity region now get NaN instead of 0.0 in ATR_20_O3, ATR_20_CH4, ATR_20_H2O columns. This properly distinguishes physically invalid data from actual zero values. Downstream GWP summation is unaffected (.fillna(0.0) before summing).
  • CO₂ AGWP coefficients — Updated CO2_AGWP_COEFF_WM2YR_PER_KG to latest AirClim values (Dahlmann et al., 2025): 24.12e-15, 47.50e-15, 74.24e-15 for H20/H50/H100.

✨ Features

  • Low-speed point filter — New speed_filter module removes trajectory points with TAS below BADA's stall speed (VStall), preventing numerical instability in the TEM equation. Integrates gracefully in the performance pipeline with fallback on failure.
  • v_stall_cas on BADA adapters — Exposed stall speed computation on BaseBADAAdapter, delegating to pyBADA's FlightEnvelope.VStall.
  • Low-altitude flight rejection — New max_pressure_level parameter (default 500 hPa) in TrajectoryParserParams. Flights that never reach sufficient altitude for contrail analysis are rejected early.
  • Efficacy squaring — Squared the efficacy term in the aCCF scaling formula for other species GWP computation.

🔧 Maintenance

  • pybada dependency — Moved from Makefile workaround to standard pyproject.toml dependency (>=0.1.11).
  • Aircraft mappings — Updated ECTL ICAO mapping CSVs with missing aircraft types.
  • License — Switched to EUPL-1.2 with amendment.

JarryGabriel and others added 13 commits March 23, 2026 14:04
Waypoints outside the aCCF validity region (pressure above threshold)
now get NaN instead of 0.0 in ATR_20_O3, ATR_20_CH4, ATR_20_H2O columns.

This distinguishes 'not applicable / physically invalid' from 'actually
zero'. Downstream GWP summation is unaffected because gwp.py already
uses .fillna(0.0) before summing.
Add v_stall_cas(mass, config) -> float | None to the BaseBADAAdapter
protocol and implement it on _PyBADAAdapterBase, delegating to
pyBADA's flightEnvelope.VStall. Returns None gracefully when CLmax
data is unavailable.

Also adds mypy ignore_errors for tests/ and scripts/ overrides,
aligning with the Makefile scope (mypy src/pyneats/ only).

Closes: AXM-812
Add filter_low_speed_points() in speed_filter module that removes
trajectory points with TAS below the BADA adapter's stall speed.
Follows the same pattern as the existing altitude_filter.

Closes: AXM-813
Call filter_low_speed_points after adapter resolution in
run_by_bada_version. On any filter failure, degrade gracefully and
proceed with unfiltered data.

Extract _build_result from inline guardrail+efficiency+output code
for testability.

Closes: AXM-814
…ther

The speed filter was operating on the FlightWithWeather object while
the downstream performance pipeline iterated on the separate `df`
DataFrame, making the filter a no-op.

Refactor filter_low_speed_points to accept/return pd.DataFrame so it
directly modifies the data used by the TEM equation. Update all tests
to match the new API.

Refs: AXM-813, AXM-814
…al., 2025)

Updated CO2_AGWP_COEFF_WM2YR_PER_KG values:
- H20: 24.16e-15 → 24.12e-15
- H50: 47.57e-15 → 47.50e-15
- H100: 74.36e-15 → 74.24e-15
pybada >=0.1.11 now supports standard pip/uv install, removing the
need for the --no-deps --ignore-requires-python workaround.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add max_pressure_level parameter (default 500 hPa) to TrajectoryParserParams.
NeatsTrajectoryParser.run() now checks Flight.level.min() after building
the Flight object and rejects trajectories that never reach high enough
altitude for contrail analysis.

Includes 4 new tests in TestParsingGuardrailPressureLevel.
The LICENSE file was renamed to LICENSE.md but pyproject.toml still
referenced the old name, breaking hatchling builds.

Also fixes two ruff lint errors (import sort + blank line whitespace).
Pre-commit used ruff v0.9.2 while CI ran v0.14.11, causing formatting
discrepancies on neats_default_parameters.py.
@JarryGabriel
JarryGabriel merged commit bf3aa7b into main Mar 25, 2026
6 checks passed
@JarryGabriel
JarryGabriel deleted the fix/accf-validity-mask-nan branch March 25, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants